package appconfig

import "github.com/spf13/viper"

type MySQLConfig struct {
	Host     string
	Port     int
	User     string
	Password string
}

type RedisConfig struct {
	Host     string
	Password string
}

type Config struct {
	MySQLConfig
	RedisConfig
}

var AppConfig Config
var err error

func Init() {
	viper.SetConfigFile("./appconfig/dev.yaml")
	err = viper.ReadInConfig()
	err = viper.Unmarshal(&AppConfig)
}
